<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: appHeader"></head>
<body id="history-body" ontouchstart>
<div class="weui-form-preview">
    <div class="weui-form-preview__hd">
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">生产令号</label>
            <b class="weui-form-preview__item" th:text="${sheet.prodNo}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">图号</label>
            <b class="weui-form-preview__item" th:text="${sheet.drawNo}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">零件名称</label>
            <b class="weui-form-preview__item" th:text="${sheet.drawName}"></b>
        </div>
        <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">零件数量</label>
            <b class="weui-form-preview__item" th:text="${sheet.drawNum}"></b>
        </div>
    </div>
    <h2 th:if="${content != null}" style="margin-top: 16px;text-align: center" th:text="${content}"></h2>
<!--    <h2 th:if="${content == null and  #lists.isEmpty(list)} and ${#lists.isEmpty(completeList)}" style="margin-top: 16px;text-align: center">查无记录</h2>-->
<!--    <h2 th:if="${content == null and #lists.isEmpty(list)} and ${completeList.size() > 0}" style="margin-top: 16px;text-align: center">该零件已全部转序</h2>-->
    <div th:each="r : ${list}">
        <form>
            <input type="hidden" name="id" th:value="${r.id}">
            <input type="hidden" name="routeId" th:value="${r.routeId}">

            <div class="weui-form-preview__bd">
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">工艺路线</label>
                    <b class="weui-form-preview__item" th:text="${r.route}"></b>
                </div>
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">数量</label>
                    <b class="weui-form-preview__item" th:text="${r.num}"></b>
                </div>
            </div>
            <div class="weui-form-preview__ft">
                <a href="javascript:void(0);" class="weui-btn weui-btn_mini weui-btn_primary btn-rec">转序接收</a>
            </div>
        </form>
    </div>
</div>

<div th:include="include :: appFooter"></div>
<script th:inline="javascript">

    $(function () {
        $('.btn-rec').click(function (e) {
            let $form = $(e.currentTarget).parents("form");
            $.operate.submit({
                url: ctx + 'rec',
                data: new FormData($form[0]),
                fun: function () {
                    location.href = ctx + "index";
                }
            });
        })
    })

</script>
</body>
</html>